package com.hehua.SimpleFactoryTwo;

/**
 * 创建图形工厂
 */
public abstract class ChartFactory {
    public static Chart createChart(String arg){
        Chart chart = null;
        if (arg.equalsIgnoreCase("histogram")){
            chart = new HistogramChart();
        }else if (arg.equalsIgnoreCase("pie")){
            chart = new PieChart();
        }else if (arg.equalsIgnoreCase("line")){
            chart = new LineChart();
        }
        return chart;
    }
}
